// Inclusion guard start
#ifndef CHARACTER_H
#define CHARACTER_H

// Include types
#include "types.h"

// We must know of the game engine and this function
class GameEngine;
bool gameEngine_checkCollision(GameEngine* gameEngine, u16 x, u16 y, BoundingBox* boundingBox, u32 check);

class Character
{
	// Public
	public:
		// Variables
			// Character type
			CharacterType type;

			// Position
			s32 x;
			s32 y;

			// Velocity
			f32 xSpeed;
			f32 ySpeed;

			// Direction (left=-1; right=1)
			s8 direction;

		// Bounding box
		BoundingBox boundingBox;

		// Current image
			// Surface
			SDL_Surface* currentImage;

			// Offsets
			s16 xOffset;
			s16 yOffset;

		// Status
			// On ground
			bool onGround;

			// Jump time
			u16 jumpTime;


		// Functions
			/** Constructor
			  *
			  * @param type type of this character
			  * @param x x starting position
			  * @param y y starting position
			  * @param direction starting direction
			  * @param gameEngine game engine who holds this character
			  */
			Character(CharacterType type, u32 x, u32 y, s16 direction, GameEngine* gameEngine);

			/** @brief iterates the character
			  */
			void iterate();

			/** @brief sets character's action flags
			  */
			void setActions(u32 actions);


	// Private
	private:
		// Variables
			// Actions
			u32 actions;

			// Game engine
			GameEngine* gameEngine;
};

// Inclusion guard end
#endif
